import request from '@/utils/request'

const getUserAPI = () => {
  return request({
    method: 'get',
    url: '/v1_0/user'

  })
}
// 个人资料
const getUserProfileAPI = () => {
  return request({
    method: 'get',
    url: '/v1_0/user/profile'
  })
}
// 上传图片

const uploadPhotoAPI = ({ formData }) => {
  return request({
    method: 'patch',
    url: '/v1_0/user/photo',
    data: formData

  })
}
// 更新资料了
const updateUsrprofileAPI = ({
  birthday,
  name
}) => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/profile',
    data: {
      birthday,
      name
    }
  })
}
// 用户 - 更新token
const refreshTokenAPI = () => {
  return request({
    url: '/v1_0/authorizations',
    method: 'PUT'

  })
}
export {
  getUserAPI,
  getUserProfileAPI,
  uploadPhotoAPI,
  updateUsrprofileAPI,
  refreshTokenAPI
}
